import { Global, Module } from "@nestjs/common";
import { JwtModule } from "@nestjs/jwt";
import { jwtConstants } from "./constants";
import { AuthRepositry } from "./auth.repositry";
import { TypeOrmModule } from "@nestjs/typeorm";
import { MenuGtag } from "src/modules/system/menu/entity/menuGtag.entity";
import { MenuHandle } from "src/modules/system/menu/entity/handle.entity";

@Global()
@Module({
  imports: [
    JwtModule.register({
      global: true,
      secret: jwtConstants.secret,
      signOptions: {
        expiresIn: '24h'
      }
    }),
    TypeOrmModule.forFeature([
      MenuHandle,
      MenuGtag
    ])
  ],
  providers: [AuthRepositry],
  exports: [JwtModule, AuthRepositry]
})
export class AuthModule { }